package cn.tedu.egweibo0416.base.config;

import cn.tedu.egweibo0416.base.interceptors.LoginCheckInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class interceptorConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new LoginCheckInterceptor())
                .addPathPatterns("/v1/user/**","/v1/weibo/**")
                .excludePathPatterns("/v1/user/reg","/v1/user/login","/v1/comment/selectByWeiboId");
    }
}
